﻿#include "FITKAbaMaterialHyperElastic.h"


Interface::FITKAbaMaterialBehaviorEnum::FITKAbaMaterialBehaviorType Interface::FITKAbaMaterialHyperElastic::getMaterialBehaviorType()
{
    return Interface::FITKAbaMaterialBehaviorEnum::FITKAbaMaterialBehaviorType::Hyperelastic;
}

Interface::FITKAbaMaterialBehaviorEnum::HyperelasticMaterialType Interface::FITKAbaMaterialHyperElastic::getMaterialType() const
{
    return m_materialType;
}

void Interface::FITKAbaMaterialHyperElastic::setMaterialType(FITKAbaMaterialBehaviorEnum::HyperelasticMaterialType type)
{
    m_materialType = type;
}

bool Interface::FITKAbaMaterialHyperElastic::getUseTemperatureDependentData() const
{
    return m_useTemperatureDependentData;
}

void Interface::FITKAbaMaterialHyperElastic::setUseTemperatureDependentData(bool stat)
{
    m_useTemperatureDependentData = stat;
    if (!m_useTemperatureDependentData)
        m_isoMooneyRivlinDatas.resize(1);
}

Interface::FITKAbaMaterialBehaviorEnum::HyperelasticIsotropicStrainEnergyPotential Interface::FITKAbaMaterialHyperElastic::getIsoStrainEnergyPotential() const
{
    return m_isoStrainEnergyPotential;
}

void Interface::FITKAbaMaterialHyperElastic::setIsoStrainEnergyPotential(FITKAbaMaterialBehaviorEnum::HyperelasticIsotropicStrainEnergyPotential type)
{
    m_isoStrainEnergyPotential = type;
}

Interface::FITKAbaMaterialBehaviorEnum::HyperelasticIsotropicInputSource Interface::FITKAbaMaterialHyperElastic::getIsoInputSource() const
{
    return m_isoInputSource;
}

void Interface::FITKAbaMaterialHyperElastic::setIsoInputSource(FITKAbaMaterialBehaviorEnum::HyperelasticIsotropicInputSource type)
{
    m_isoInputSource = type;
}

Interface::FITKAbaMaterialBehaviorEnum::HyperelasticIsoModuliTimeScale Interface::FITKAbaMaterialHyperElastic::getIsoModuliTimeScale() const
{
    return m_isoModuliTimeScale;
}

void Interface::FITKAbaMaterialHyperElastic::setIsoModuliTimeScale(FITKAbaMaterialBehaviorEnum::HyperelasticIsoModuliTimeScale type)
{
    m_isoModuliTimeScale = type;
}

int Interface::FITKAbaMaterialHyperElastic::getIsoMooneyRivlinDataRows() const
{
    return m_isoMooneyRivlinDatas.size();
}

void Interface::FITKAbaMaterialHyperElastic::setIsoMooneyRivlinDataRows(int rows)
{
    if (!m_useTemperatureDependentData)
        return;
    if (rows <= 1)
        return;
    m_isoMooneyRivlinDatas.resize(rows);
}

void Interface::FITKAbaMaterialHyperElastic::insertIsoMooneyRivlinDataRow(int index)
{
    if (!m_useTemperatureDependentData)
        return;
    m_isoMooneyRivlinDatas.insert(index, MooneyRivlinData());
}

void Interface::FITKAbaMaterialHyperElastic::removeIsoMooneyRivlinDataRow(int index)
{
    if (!m_useTemperatureDependentData)
        return;
    if (index >= 0 && index < m_isoMooneyRivlinDatas.size())
        m_isoMooneyRivlinDatas.removeAt(index);
}

double Interface::FITKAbaMaterialHyperElastic::getIsoMooneyRivlinC10(int index) const
{
    if (index >= 0 && index < m_isoMooneyRivlinDatas.size())
        return m_isoMooneyRivlinDatas[index].getC10();
    return 0.0;
}

double Interface::FITKAbaMaterialHyperElastic::getIsoMooneyRivlinC01(int index) const
{
    if (index >= 0 && index < m_isoMooneyRivlinDatas.size())
        return m_isoMooneyRivlinDatas[index].getC01();
    return 0.0;
}

double Interface::FITKAbaMaterialHyperElastic::getIsoMooneyRivlinD1(int index) const
{
    if (index >= 0 && index < m_isoMooneyRivlinDatas.size())
        return m_isoMooneyRivlinDatas[index].getD1();
    return 0.0;
}

double Interface::FITKAbaMaterialHyperElastic::getIsoMooneyRivlinTemperature(int index) const
{
    if (index >= 0 && index < m_isoMooneyRivlinDatas.size())
        return m_isoMooneyRivlinDatas[index].getTemperature();
    return 0.0;
}

void Interface::FITKAbaMaterialHyperElastic::setIsoMooneyRivlinC10(double value, int index)
{
    if (index >= 0 && index < m_isoMooneyRivlinDatas.size())
        m_isoMooneyRivlinDatas[index].setC10(value);
}

void Interface::FITKAbaMaterialHyperElastic::setIsoMooneyRivlinC01(double value, int index)
{
    if (index >= 0 && index < m_isoMooneyRivlinDatas.size())
        m_isoMooneyRivlinDatas[index].setC01(value);
}

void Interface::FITKAbaMaterialHyperElastic::setIsoMooneyRivlinD1(double value, int index)
{
    if (index >= 0 && index < m_isoMooneyRivlinDatas.size())
        m_isoMooneyRivlinDatas[index].setD1(value);
}

void Interface::FITKAbaMaterialHyperElastic::setIosMooneyRivlinTemperature(double value, int index)
{
    if (index >= 0 && index < m_isoMooneyRivlinDatas.size())
        m_isoMooneyRivlinDatas[index].setTemperature(value);
}
